package singleton;
public class TestSingleton {
    public static void main(String[] args) {
        // 获取ResourceManager实例
        ResourceManager manager1 = ResourceManager.getInstance();
        ResourceManager manager2 = ResourceManager.getInstance();

        // 验证是否是同一个实例
        System.out.println("manager1 == manager2: " + (manager1 == manager2));

        // 获取资源标识符
        System.out.println("Resource 1: " + manager1.getResource());
        System.out.println("Resource 2: " + manager2.getResource());
        System.out.println("Resource 3: " + manager1.getResource());
    }
}
